Platform Explorer / Nuxeo Platform 5.8

Component org.nuxeo.ecm.social.mini.message.gadgets

Contributions

XML Source

<?xml version="1.0"?>
<component name="org.nuxeo.ecm.social.mini.message.gadgets" version="1.0">

  <extension target="org.nuxeo.opensocial.gadgets.service" point="gadget">

    <internalGadget name="minimessages" disabled="false">
      <documentation>
        This gadget displays the mini messages of a user, or the mini messages
        of the user's network.

        The following user preferences can be used to configure it:
        - activityLinkBuilder: activity link builder name to use to generate
          documents and user URLs
        - miniMessagesStreamType: can be 'forActor' to display the mini messages
          of the user's network, or 'fromActor' to display only the user
          mini messages.
        - actor: the actor for which to display the activities,
          default is the current user username.

        How to include the minimessages gadget in a JSF context:
        <code>
          <div class="gadget-minimessages threeQuarterWidth"></div>
          <script type="text/javascript">
            jQuery('.gadget-minimessages').openSocialGadget({
              baseURL: '#{baseURL}',
              language: '#{localeSelector.language}',
              gadgetDefs: [
                { specUrl: '#{gadgetsBaseURL}/site/gadgets/minimessages/minimessages.xml',
                  title: '',
                  userPrefs: {
                    activityLinkBuilder: {
                      value: 'default'
                    },
                    miniMessagesStreamType: {
                      value: 'forActor'
                    }
                  },
                  displayTitleBar: false,
                  width: '100%'
                }
              ]
            });
          </script>
        </code>

        How to include the minimessages gadget in a WebEngine page:
        <code>
          <link rel="stylesheet" href="${contextPath}/css/opensocial/light-container-gadgets.css" />
          <script type="text/javascript" src="${contextPath}/opensocial/gadgets/js/rpc.js?c=1"></script>
          <script type="text/javascript" src="${contextPath}/js/?scripts=jquery.js|opensocial/cookies.js|opensocial/util.js|opensocial/gadgets.js|opensocial/cookiebaseduserprefstore.js|opensocial/jquery.opensocial.gadget.js"></script>

          <div class="gadget-minimessages gadgets-gadget-chrome"></div>
          <script type="text/javascript">
            $('.gadget-minimessages').openSocialGadget({
              baseURL: '${contextPath}' + '/',
              language: '${Context.locale.language}',
              gadgetDefs: [{
                specUrl : '${Runtime.getProperty('nuxeo.loopback.url')}/site/gadgets/minimessages/minimessages.xml',
                userPrefs: {
                  activityLinkBuilder: {
                    value: 'default'
                  },
                  miniMessagesStreamType: {
                    value: 'forActor'
                  }
                },
                displayTitleBar: false,
                width: '100%'
              }]
            });
          </script>
        </code>
      </documentation>

      <mountPoint>/minimessages</mountPoint>
      <entryPoint>minimessages.xml</entryPoint>
      <category>Nuxeo</category>
      <icon>gadget-minimessages.png</icon>
    </internalGadget>

  </extension>

</component>